const { Op } = require('sequelize')
const ordermodle = require('../../modle/order')
module.exports = {
    async getorderservice(data) {
        return await ordermodle.findAll({
            where: {
                ...data
            }
        })
    },
    async getorderseachservice(orderid, userid, productid,) {
        return await ordermodle.findAll({
            where: {
                orderid: {
                    [Op.like]: `%${orderid}%`
                },
                userid: {
                    [Op.like]: `%${userid}%`
                },
                productid: {
                    [Op.like]: `%${productid}%`
                }
            }
        })
    },
    async deleorderservice(id) {
        return await ordermodle.destroy({
            where: {
                id
            }
        })
    }
}